```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OSS对象存储服务完全指南 | 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f9fafb;
            color: #1f2937;
            line-height: 1.6;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
        }
        .code-block {
            background: #1e293b;
            color: #f8fafc;
            border-radius: 0.5rem;
            overflow: hidden;
        }
        .code-header {
            background: #0f172a;
            padding: 0.5rem 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .code-body {
            padding: 1rem;
            overflow-x: auto;
        }
        .card-hover:hover {
            transform: translateY(-4px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .feature-icon {
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            font-size: 1.75rem;
            margin-bottom: 1rem;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-6xl text-center">
            <div class="inline-block px-3 py-1 mb-4 text-sm font-medium bg-white text-blue-700 rounded-full">技术指南</div>
            <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">OSS对象存储服务完全指南</h1>
            <p class="text-xl md:text-2xl text-blue-100 max-w-3xl mx-auto mb-8">掌握云存储核心技术，构建高性能、高可用的文件存储解决方案</p>
            <div class="flex justify-center space-x-4">
                <a href="#why" class="px-6 py-3 bg-white text-blue-700 font-medium rounded-lg hover:bg-blue-50 transition duration-300">为什么选择OSS</a>
                <a href="#integration" class="px-6 py-3 border-2 border-white text-white font-medium rounded-lg hover:bg-white hover:text-blue-700 transition duration-300">Java集成指南</a>
            </div>
        </div>
    </section>

    <!-- Why OSS Section -->
    <section id="why" class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">为什么选择OSS？</h2>
                <p class="text-gray-600 max-w-3xl mx-auto">文件存储的痛点与解决方案</p>
            </div>
            
            <div class="grid md:grid-cols-3 gap-8 mb-16">
                <div class="bg-white p-8 rounded-xl shadow-md hover:shadow-lg transition duration-300">
                    <div class="feature-icon bg-red-100 text-red-500">
                        <i class="fas fa-hdd"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">存储容量限制</h3>
                    <p class="text-gray-600">本地磁盘空间有限，难以应对业务快速增长的需求</p>
                </div>
                <div class="bg-white p-8 rounded-xl shadow-md hover:shadow-lg transition duration-300">
                    <div class="feature-icon bg-blue-100 text-blue-500">
                        <i class="fas fa-tachometer-alt"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">访问性能瓶颈</h3>
                    <p class="text-gray-600">高并发访问时响应慢，影响用户体验</p>
                </div>
                <div class="bg-white p-8 rounded-xl shadow-md hover:shadow-lg transition duration-300">
                    <div class="feature-icon bg-green-100 text-green-500">
                        <i class="fas fa-shield-alt"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">数据安全风险</h3>
                    <p class="text-gray-600">缺乏完善的备份和容灾机制，数据可靠性低</p>
                </div>
            </div>
            
            <div class="bg-blue-50 rounded-xl p-8 border-l-4 border-blue-500">
                <h3 class="text-2xl font-bold mb-4 text-blue-800">OSS（对象存储服务）提供了完美的解决方案</h3>
                <div class="grid md:grid-cols-3 gap-6">
                    <div class="flex items-start">
                        <div class="flex-shrink-0 h-8 w-8 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 mr-3">
                            <i class="fas fa-expand"></i>
                        </div>
                        <div>
                            <h4 class="font-bold mb-1">无限扩展</h4>
                            <p class="text-gray-700">按需使用，自动扩容</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="flex-shrink-0 h-8 w-8 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 mr-3">
                            <i class="fas fa-bolt"></i>
                        </div>
                        <div>
                            <h4 class="font-bold mb-1">高性能访问</h4>
                            <p class="text-gray-700">全球CDN加速</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="flex-shrink-0 h-8 w-8 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 mr-3">
                            <i class="fas fa-lock"></i>
                        </div>
                        <div>
                            <h4 class="font-bold mb-1">数据安全</h4>
                            <p class="text-gray-700">多重备份，99.999999999%可靠性</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Core Concepts & Integration -->
    <section id="integration" class="py-16 px-4 md:px-0 bg-gray-50">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">OSS核心概念与Java SDK集成</h2>
                <p class="text-gray-600 max-w-3xl mx-auto">快速掌握OSS的关键概念和Java集成方法</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-12 mb-16">
                <div>
                    <h3 class="text-2xl font-bold mb-6">2.1 OSS核心概念</h3>
                    <div class="space-y-6">
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-8 w-8 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-folder"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">Bucket</h4>
                                <p class="text-gray-700">存储空间，相当于文件夹</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-8 w-8 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-file"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">Object</h4>
                                <p class="text-gray-700">存储对象，相当于文件</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-8 w-8 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-globe"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">Endpoint</h4>
                                <p class="text-gray-700">访问域名</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-8 w-8 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-key"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">AccessKey</h4>
                                <p class="text-gray-700">访问密钥</p>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div>
                    <h3 class="text-2xl font-bold mb-6">2.2 Java SDK集成步骤</h3>
                    <div class="space-y-8">
                        <div>
                            <h4 class="font-bold mb-3">第一步：添加Maven依赖</h4>
                            <div class="code-block">
                                <div class="code-header">
                                    <span class="text-sm font-mono text-gray-400">pom.xml</span>
                                    <button class="text-gray-400 hover:text-white">
                                        <i class="far fa-copy"></i>
                                    </button>
                                </div>
                                <div class="code-body">
                                    <pre class="text-sm font-mono"><code>&lt;dependency&gt;
    &lt;groupId&gt;com.aliyun.oss&lt;/groupId&gt;
    &lt;artifactId&gt;aliyun-sdk-oss&lt;/artifactId&gt;
    &lt;version&gt;3.15.1&lt;/version&gt;
&lt;/dependency&gt;</code></pre>
                                </div>
                            </div>
                        </div>
                        
                        <div>
                            <h4 class="font-bold mb-3">第二步：初始化OSS客户端</h4>
                            <div class="code-block">
                                <div class="code-header">
                                    <span class="text-sm font-mono text-gray-400">OSSConfig.java</span>
                                    <button class="text-gray-400 hover:text-white">
                                        <i class="far fa-copy"></i>
                                    </button>
                                </div>
                                <div class="code-body">
                                    <pre class="text-sm font-mono"><code>@Configuration
public class OSSConfig {
    @Value("${oss.endpoint}") 
    private String endpoint;
    
    @Value("${oss.access-key-id}")
    private String accessKeyId;
    
    @Value("${oss.access-key-secret}")
    private String accessKeySecret;

    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }
}</code></pre>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="bg-white p-8 rounded-xl shadow-sm border border-gray-200">
                <h4 class="font-bold mb-3">第三步：配置文件</h4>
                <div class="code-block">
                    <div class="code-header">
                        <span class="text-sm font-mono text-gray-400">application.yml</span>
                        <button class="text-gray-400 hover:text-white">
                            <i class="far fa-copy"></i>
                        </button>
                    </div>
                    <div class="code-body">
                        <pre class="text-sm font-mono"><code>oss:
  endpoint: https://oss-cn-hangzhou.aliyuncs.com
  access-key-id: your-access-key-id
  access-key-secret: your-access-key-secret
  bucket-name: your-bucket-name</code></pre>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- File Operations -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">基础文件操作实战</h2>
                <p class="text-gray-600 max-w-3xl mx-auto">掌握OSS核心API操作，满足日常开发需求</p>
            </div>
            
            <div class="grid md:grid-cols-3 gap-8 mb-12">
                <div class="bg-gray-50 p-6 rounded-xl border border-gray-200 card-hover transition duration-300">
                    <div class="text-blue-600 mb-4">
                        <i class="fas fa-cloud-upload-alt text-3xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">文件上传</h3>
                    <p class="text-gray-600 mb-4">支持多种上传方式，简单易用</p>
                    <div class="code-block">
                        <div class="code-header">
                            <span class="text-sm font-mono text-gray-400">FileService.java</span>
                        </div>
                        <div class="code-body">
                            <pre class="text-xs font-mono"><code>public String uploadFile(String objectName, InputStream inputStream) {
    ossClient.putObject(bucketName, objectName, inputStream);
    return generateUrl(objectName);
}</code></pre>
                        </div>
                    </div>
                </div>
                
                <div class="bg-gray-50 p-6 rounded-xl border border-gray-200 card-hover transition duration-300">
                    <div class="text-green-600 mb-4">
                        <i class="fas fa-cloud-download-alt text-3xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">文件下载</h3>
                    <p class="text-gray-600 mb-4">高效获取文件内容，支持流式处理</p>
                    <div class="code-block">
                        <div class="code-header">
                            <span class="text-sm font-mono text-gray-400">FileService.java</span>
                        </div>
                        <div class="code-body">
                            <pre class="text-xs font-mono"><code>public InputStream downloadFile(String objectName) {
    return ossClient.getObject(bucketName, objectName)
                   .getObjectContent();
}</code></pre>
                        </div>
                    </div>
                </div>
                
                <div class="bg-gray-50 p-6 rounded-xl border border-gray-200 card-hover transition duration-300">
                    <div class="text-red-600 mb-4">
                        <i class="fas fa-trash-alt text-3xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">文件删除</h3>
                    <p class="text-gray-600 mb-4">安全删除不再需要的文件</p>
                    <div class="code-block">
                        <div class="code-header">
                            <span class="text-sm font-mono text-gray-400">FileService.java</span>
                        </div>
                        <div class="code-body">
                            <pre class="text-xs font-mono"><code>public void deleteFile(String objectName) {
    ossClient.deleteObject(bucketName, objectName);
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Advanced Features -->
    <section class="py-16 px-4 md:px-0 bg-gray-50">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">高级功能实战</h2>
                <p class="text-gray-600 max-w-3xl mx-auto">探索OSS的强大功能，应对复杂业务场景</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-10">
                <div>
                    <h3 class="text-2xl font-bold mb-6">4.1 分片上传（大文件优化）</h3>
                    <p class="text-gray-700 mb-6">处理大文件上传的最佳实践，支持断点续传和并行上传</p>
                    <div class="code-block">
                        <div class="code-header">
                            <span class="text-sm font-mono text-gray-400">FileService.java</span>
                        </div>
                        <div class="code-body">
                            <pre class="text-xs font-mono"><code>public String uploadLargeFile(String objectName, InputStream inputStream) {
    // 初始化分片上传
    InitiateMultipartUploadRequest request = 
        new InitiateMultipartUploadRequest(bucketName, objectName);
    InitiateMultipartUploadResult result = 
        ossClient.initiateMultipartUpload(request);
    String uploadId = result.getUploadId();

    // 分片上传逻辑
    List&lt;PartETag&gt; partETags = new ArrayList&lt;&gt;();
    byte[] buffer = new byte[5 * 1024 * 1024]; // 5MB每片
    int partNumber = 1;
    int bytesRead;
    while ((bytesRead = inputStream.read(buffer)) != -1) {
        UploadPartRequest uploadRequest = new UploadPartRequest()
            .withBucketName(bucketName)
            .withKey(objectName)
            .withUploadId(uploadId)
            .withPartNumber(partNumber++)
            .withInputStream(new ByteArrayInputStream(buffer, 0, bytesRead))
            .withPartSize(bytesRead);
        partETags.add(ossClient.uploadPart(uploadRequest).getPartETag());
    }

    // 完成上传
    CompleteMultipartUploadRequest completeRequest = 
        new CompleteMultipartUploadRequest(bucketName, objectName, uploadId, partETags);
    ossClient.completeMultipartUpload(completeRequest);

    return generateUrl(objectName);
}</code></pre>
                        </div>
                    </div>
                </div>
                
                <div>
                    <div class="mb-10">
                        <h3 class="text-2xl font-bold mb-6">4.2 文件权限管理</h3>
                        <p class="text-gray-700 mb-4">精细控制文件访问权限，保障数据安全</p>
                        <div class="code-block">
                            <div class="code-header">
                                <span class="text-sm font-mono text-gray-400">FileService.java</span>
                            </div>
                            <div class="code-body">
                                <pre class="text-xs font-mono"><code>public void setFileACL(String objectName, CannedAccessControlList acl) {
    ossClient.setObjectAcl(bucketName, objectName, acl);
}</code></pre>
                            </div>
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-2xl font-bold mb-6">4.3 文件生命周期管理</h3>
                        <p class="text-gray-700 mb-4">自动化文件管理，节省存储成本</p>
                        <div class="code-block">
                            <div class="code-header">
                                <span class="text-sm font-mono text-gray-400">FileService.java</span>
                            </div>
                            <div class="code-body">
                                <pre class="text-xs font-mono"><code>public void setLifecycleRule(String ruleId, String prefix, int expirationDays) {
    LifecycleRule rule = new LifecycleRule(ruleId, prefix, 
        RuleStatus.Enabled, expirationDays);
    LifecycleConfiguration config = new LifecycleConfiguration()
        .withRules(rule);
    ossClient.setBucketLifecycleConfiguration(bucketName, config);
}</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Optimization & Best Practices -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">性能优化与最佳实践</h2>
                <p class="text-gray-600 max-w-3xl mx-auto">提升OSS使用效率的关键技巧</p>
            </div>
            
            <div class="grid md:grid-cols-3 gap-8 mb-12">
                <div class="bg-indigo-50 p-6 rounded-xl">
                    <h3 class="text-xl font-bold mb-4 text-indigo-800">5.1 客户端优化</h3>
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-plug text-xs"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">连接池配置</h4>
                                <p class="text-gray-700 text-sm">复用HTTP连接提高性能</p>
                            </div>
                        </div>
                        <div class="code-block">
                            <div class="code-body">
                                <pre class="text-xs font-mono"><code>ClientConfiguration config = new ClientConfiguration()
    .setMaxConnections(200)
    .setConnectionTimeout(5000)
    .setSocketTimeout(5000);
OSS ossClient = new OSSClientBuilder()
    .build(endpoint, accessKeyId, accessKeySecret, config);</code></pre>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-sync-alt text-xs"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">异步上传</h4>
                                <p class="text-gray-700 text-sm">提高系统吞吐量</p>
                            </div>
                        </div>
                        <div class="code-block">
                            <div class="code-body">
                                <pre class="text-xs font-mono"><code>public CompletableFuture&lt;String&gt; uploadFileAsync(String objectName, InputStream inputStream) {
    return CompletableFuture.supplyAsync(
        () -> uploadFile(objectName, inputStream));
}</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="bg-purple-50 p-6 rounded-xl">
                    <h3 class="text-xl font-bold mb-4 text-purple-800">5.2 服务端优化</h3>
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-purple-100 text-purple-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-rocket text-xs"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">CDN加速</h4>
                                <p class="text-gray-700 text-sm">配置OSS绑定CDN域名</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-purple-100 text-purple-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-compress-alt text-xs"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">压缩传输</h4>
                                <p class="text-gray-700 text-sm">启用Gzip压缩减少流量</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-purple-100 text-purple-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-database text-xs"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">缓存策略</h4>
                                <p class="text-gray-700 text-sm">设置合适的Cache-Control</p>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="bg-teal-50 p-6 rounded-xl">
                    <h3 class="text-xl font-bold mb-4 text-teal-800">5.3 安全防护</h3>
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-teal-100 text-teal-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-user-shield text-xs"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">STS临时授权</h4>
                                <p class="text-gray-700 text-sm">避免直接使用AccessKey</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-teal-100 text-teal-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-link-slash text-xs"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">防盗链设置</h4>
                                <p class="text-gray-700 text-sm">防止资源盗用</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-teal-100 text-teal-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-clipboard-list text-xs"></i>
                            </div>
                            <div>
                                <h4 class="font-bold mb-1">日志监控</h4>
                                <p class="text-gray-700 text-sm">实时监控访问日志</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Case Study -->
    <section class="py-16 px-4 md:px-0 bg-gray-50">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">实战案例：图片处理服务</h2>
                <p class="text-gray-600 max-w-3xl mx-auto">基于OSS构建完整的图片处理解决方案</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-12">
                <div>
                    <h3 class="text-2xl font-bold mb-6">6.1 需求场景</h3>
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-check text-xs"></i>
                            </div>
                            <div>
                                <p class="text-gray-700">上传图片到OSS</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-check text-xs"></i>
                            </div>
                            <div>
                                <p class="text-gray-700">自动生成缩略图</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center mr-3 mt-1">
                                <i class="fas fa-check text-xs"></i>
                            </div>
                            <div>
                                <p class="text-gray-700">支持图片水印</p>
                            </div>
                        </li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-2xl font-bold mb-6">6.2 代码实现</h3>
                    <div class="space-y-6">
                        <div>
                            <h4 class="font-bold mb-3">图片上传与处理</h4>
                            <div class="code-block">
                                <div class="code-header">
                                    <span class="text-sm font-mono text-gray-400">FileService.java</span>
                                </div>
                                <div class="code-body">
                                    <pre class="text-xs font-mono"><code>public String uploadImage(MultipartFile file) {
    String originalName = file.getOriginalFilename();
    String objectName = "images/" + UUID.randomUUID() 
        + getFileExtension(originalName);
    
    // 上传原图
    ossClient.putObject(bucketName, objectName, file.getInputStream());
    
    // 生成缩略图
    String thumbnailName = "thumbnails/" + objectName;
    String style = "image/resize,m_fixed,w_200,h_200";
    ossClient.processObject(bucketName, objectName, thumbnailName, style);
    
    return generateUrl(objectName);
}</code></pre>
                                </div>
                            </div>
                        </div>
                        
                        <div>
                            <h4 class="font-bold mb-3">图片水印</h4>
                            <div class="code-block">
                                <div class="code-header">
                                    <span class="text-sm font-mono text-gray-400">FileService.java</span>
                                </div>
                                <div class="code-body">
                                    <pre class="text-xs font-mono"><code>public String addWatermark(String objectName) {
    String watermarkedName = "watermarked/" + objectName;
    String style = "image/watermark,text_SGVsbG8gV29ybGQ"; // Base64编码的"Hello World"
    ossClient.processObject(bucketName, objectName, watermarkedName, style);
    return generateUrl(watermarkedName);
}</code></pre>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Concept Visualization -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">OSS核心概念关系图</h2>
                <p class="text-gray-600 max-w-3xl mx-auto">可视化理解OSS架构与组件关系</p>
            </div>
            
            <div class="bg-gray-50 p-8 rounded-xl">
                <div class="mermaid">
                    graph TD
                        A[用户应用] -->|调用| B(Java SDK)
                        B -->|操作| C[Bucket]
                        C -->|包含| D[Object]
                        D -->|存储| E[文件数据]
                        A -->|访问| F[Endpoint]
                        F -->|路由| C
                        B -->|认证| G[AccessKey]
                        G -->|权限控制| C
                        C -->|配置| H[生命周期规则]
                        C -->|配置| I[访问权限]
                        C -->|配置| J[日志记录]
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-12 px-4">
        <div class="container mx-auto max-w-6xl text-center">
            <h3 class="text-xl font-bold text-white mb-4">技术小馆</h3>
            <p class="mb-6">专业的开发者知识分享平台</p>
            <a href="http://www.yuque.com/jtostring" class="text-blue-400 hover:text-blue-300 transition duration-300">http://www.yuque.com/jtostring</a>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
        
        // 复制代码功能
        document.querySelectorAll('.code-header button').forEach(button => {
            button.addEventListener('click', () => {
                const codeBlock = button.closest('.code-block');
                const code = codeBlock.querySelector('code').innerText;
                navigator.clipboard.writeText(code);
                
                const originalIcon = button.innerHTML;
                button.innerHTML = '<i class="fas fa-check"></i>';
                
                setTimeout(() => {
                    button.innerHTML = originalIcon;
                }, 2000);
            });
        });
    </script>
</body>
</html>
```